package com.ycsj.goldmedalnewconcept.common.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ycsj.goldmedalnewconcept.R;
import com.ycsj.goldmedalnewconcept.common.bean.VersionInfo;

import java.util.List;

/**
 * 版本介绍列表适配器
 * Created by Kevin on 2019/2/26
 */

public class VersionRvAdapter extends BaseQuickAdapter<VersionInfo, BaseViewHolder> {

    private Context context;
    private LinearLayout.LayoutParams lp;

    public VersionRvAdapter(Context context, int layoutResId, @Nullable List<VersionInfo> data) {
        super(layoutResId, data);
        this.context = context;
    }


    @Override
    protected void convert(BaseViewHolder helper, VersionInfo item) {
// 标题
        TextView tvName = helper.getView(R.id.tv_name);
//        tvName.setText(item.getName());

        // 更新内容
        TextView tvContent = helper.getView(R.id.tv_content);
        tvContent.setText(item.getContent());

        // 更新版本号
        TextView tvVersion = helper.getView(R.id.tv_version);
        tvVersion.setText("商店版本号:" + item.getVersion());

    }
}
